<{include file="tpl/filter.tpl"}>

<div>
    <a class="label-success pull-right" style="color: #fff; padding: 0 4px;" href="<{PubFunc::buildUrl('/oss/?r=white/add')}>">
        <i class="fa fa-plus"></i> 添加白名单
    </a>
</div>

<{include file="tpl/grid.tpl"}>

<!--<style>
    .th-title { background: #f4f4f4; text-align: center; }
    .btn.btn-primary, .btn.btn-primary:hover { background-color: #008678; border-color: #008678; }
</style>

<div style="margin-bottom: 20px;">
    <form method="get" action="/oss/?r=white/index&g=nws&p=testr&m=37">
        <input type="hidden" name="r" value="<{$beforeAction.Current.Route}>"/>
        <input type="hidden" name="m" value="<{$beforeAction.Current.MenuID}>"/>
        <input type="hidden" name="g" value="<{$beforeAction.Current.GameSrc}>"/>
        <input type="hidden" name="p" value="<{$beforeAction.Current.Platform}>"/>

        <div class="form-group">
            <label for="exampleInputFile">服务器</label>
            <select class="form-control" name="server">
                <{html_options options=$serverList selected=$server}>
            </select>
        </div>

        <div class="form-group">
            <label for="exampleInputFile">逻辑服务器</label>
            <select class="form-control" id="logic-sel">
                <{html_options options=$logicList selected=$logic}>
            </select>
            <input type="text" class="form-control" id="logic-input" name="logic" value="<{$logic}>" />
        </div>

        <div class="form-group">
            <label for="exampleInputFile">账号名称</label>
            <input type="text" class="form-control" name="search" value="<{$search}>">
        </div>

        <{if $result}><p class="bg-info" style="padding: 8px 12px;"><{$result}></p><{/if}>

        <input class="btn btn-default btn-flat" type="submit" value="查询是否在白名单" />

        <div class="pull-right">
            <input class="btn btn-success btn-flat btn-do" data-action="add" type="button" value="添加白名单" />
            <input class="btn btn-danger btn-flat btn-do" data-action="del" type="button" value="删除白名单" />
        </div>

    </form>
</div>-->

<!--<script type="text/javascript">
    $(function(){
        if($("#logic-sel").val()){
            $("#logic-input").hide();
        }else{
            $("#logic-input").show();
        }

        $(".btn-do").click(function(){
            var form = $(this).closest('form'),
                action = $(this).attr('data-action');

            $.get('/oss/?r=white/' + action, {
                'g' : '<{$beforeAction.Current.GameSrc}>',
                'p' : '<{$beforeAction.Current.Platform}>',
                'server' : form.find('[name="server"]').val(),
                'search' : form.find('[name="search"]').val(),
                'logic'  : form.find('[name="logic"]').val()
            }, function(rs){
                alert(rs.msg);
                if(rs.state){
                    window.location.reload();
                }
            }, 'json');
        });

        $("#logic-sel").change(function(){
            var value = $(this).val();

            if(value){
                $("#logic-input").val(value).hide();
            }else{
                $("#logic-input").val('').show();
            }
        });
    });
</script>-->